<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="util.TourRouteDao" %>
<%@ page import="bean.TourRoute" %>
<%@ page import="bean.person" %>
<html>
<head>
    <title>爱旅行</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" href="fonts/icomoon/style.css">

    <link rel="stylesheet" href="css/bootstrap.min.css">

    <link rel="stylesheet" href="css/bootstrap-datepicker.css">

    <link rel="stylesheet" href="css/style.css">

</head>
<body>

<div class="site-wrap">

    <div class="site-mobile-menu">
        <div class="site-mobile-menu-header">
            <div class="site-mobile-menu-close mt-3">
                <span class="icon-close2 js-menu-toggle"></span>
            </div>
        </div>
        <div class="site-mobile-menu-body"></div>
    </div>

    <header class="site-navbar py-1" role="banner">

        <div class="container">
            <div class="row align-items-center">

                <div class="col-6 col-xl-2">
                    <h1 class="mb-0"><a href="http://localhost:8080/index.jsp" class="text-black h2 mb-0">爱旅行</a></h1>
                </div>
                <div class="col-10 col-md-8 d-none d-xl-block">
                    <nav class="site-navigation position-relative text-right text-lg-center" role="navigation">

                        <ul class="site-menu js-clone-nav mx-auto d-none d-lg-block">
                            <li>
                                <h3>
                                    <a href="http://localhost:8080/index.jsp">首页</a>
                                </h3>
                            </li>
                            <li>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </li>

                            <li>
                                <h3>
                                    <a href="http://localhost:8080/manage">管理</a>
                                </h3>
                            </li>
                        </ul>
                    </nav>
                </div>

                <%
                    person p = (person) request.getSession().getAttribute("person");
                    if(p == null){
                %>
                <div class="col-6 col-xl-2 text-right">
                    <div class="d-none d-xl-inline-block">
                        <ul class="site-menu js-clone-nav ml-auto list-unstyled d-flex text-right mb-0" data-class="social">
                            <li>
                                <a href="http://localhost:8080/login.jsp?jmpFlag=0" class="pl-0 pr-3 text-black"><span class="icon-tripadvisor"></span>登陆</a>
                            </li>
                            <li>
                                <a href="http://localhost:8080/tourist/register.jsp" class="pl-3 pr-3 text-black"><span class="icon-twitter"></span>注册</a>
                            </li>
                        </ul>
                    </div>

                    <div class="d-inline-block d-xl-none ml-md-0 mr-auto py-3" style="position: relative; top: 3px;"><a href="#" class="site-menu-toggle js-menu-toggle text-black"><span class="icon-menu h3"></span></a></div>

                </div>
                <%
                    }else{
                %>
                <div class="col-6 col-xl-2 text-right">
                    <div class="d-none d-xl-inline-block">
                        <ul class="site-menu js-clone-nav ml-auto list-unstyled d-flex text-right mb-0" data-class="social">
                            <li style="width: 200px;font-size: 15px;">
                                <a href="http://localhost:8080/index.jsp" class="text-black">欢迎您，<%=p.getUserName()%></a>
                            </li>
                            <li style="width: 50px;font-size: 14px;">
                                <a href="http://localhost:8080/logout" class="pl-3 text-black">退出</a>
                            </li>
                        </ul>
                    </div>

                    <div class="d-inline-block d-xl-none ml-md-0 mr-auto py-3" style="position: relative; top: 3px;"><a href="#" class="site-menu-toggle js-menu-toggle text-black"><span class="icon-menu h3"></span></a></div>
                </div>
                <%
                    }
                %>
            </div>
        </div>

    </header>





    <div class="site-blocks-cover inner-page-cover" style="background-image: url(images/hero_bg_2.jpg);" data-aos="fade" data-stellar-background-ratio="0.5">
        <div class="container">
            <div class="row align-items-center justify-content-center text-center">

                <div class="col-md-8" data-aos="fade-up" data-aos-delay="400">
                    <h3 class="text-white font-weight-light">来选择你心仪的旅行地吧</h3>
                    <div><a href="http://localhost:8080/index.jsp">首页</a> <span class="mx-2 text-white">&bullet;</span> <span class="text-white">管理</span></div>

                </div>
            </div>
        </div>
    </div>


    <%
        TourRouteDao trdao = new TourRouteDao();
        List<TourRoute> TRList = trdao.query();
        String type = "routeNo";
    %>

    <div class="site-section">

        <div class="container">

            <div class="row">
                <%
                    for(TourRoute tr : TRList){
                        System.out.println(tr.getRouteNo()+"-"+tr.getStartPoint()+"-"+tr.getEndPoint()+"-"+tr.getDays()+"-"+tr.getAttraction()+tr.getImageURL());
                %>
                <div class="col-md-6 col-lg-4 mb-4 mb-lg-4">
                    <a href="http://localhost:8080/signUp?type=<%=type%>&routeNo=<%=tr.getRouteNo()%>" class="unit-1 text-center" style="width: 350px;height: 300px;">
                        <img src="images/<%=tr.getImageURL()%>" alt="Image" class="img-fluid">
                        <div class="unit-1-text">
                            <strong class="text-primary mb-2 d-block"><%=tr.getAttraction()%></strong>
                            <h3 class="unit-1-heading"><%=tr.getStartPoint()%>-<%=tr.getEndPoint()%></h3>
                            <h3 class="unit-1-heading"><%=tr.getDays()%>天</h3>
                        </div>
                    </a>
                </div>
                <%
                    }
                %>
            </div>
        </div>

    </div>


    <footer class="site-footer">
        <div class="container">
            <div class="row">
                <div class="col-lg-4">
                    <div class="mb-5">
                        <h3 class="footer-heading mb-4">关于我们</h3>
                        <p>我们是一个致力于给用户提供旅游报名服务的团队</p>
                    </div>



                </div>
                <div class="col-lg-4 mb-5 mb-lg-0">
                    <div class="row mb-5">
                        <div class="col-md-12">
                            <h3 class="footer-heading mb-4">友情链接</h3>
                        </div>
                        <div class="col-md-6 col-lg-6">
                            <ul class="list-unstyled">
                                <li><a href="http://www.lvy.cn">驴友网</a></li>
                                <li><a href="https://www.qyer.com">穷游网</a></li>
                                <li><a href="https://www.ly.com/">同程旅游</a></li>
                                <li><a href="http://www.tuniu.com">途牛旅游网</a></li>
                            </ul>
                        </div>
                        <div class="col-md-6 col-lg-6">
                            <ul class="list-unstyled">
                                <li><a href="https://www.ctrip.com">携程</a></li>
                                <li><a href="https://www.qunar.com">去哪儿</a></li>
                                <li><a href="http://www.mangocity.com">芒果网</a></li>
                                <li><a href="https://www.uzai.com">悠哉旅游网</a></li>
                            </ul>
                        </div>
                    </div>



                </div>

                <div class="col-lg-4 mb-5 mb-lg-0">


                    <div class="mb-5">
                        <h3 class="footer-heading mb-2">联系我们</h3>
                        <p>QQ：871517664</p>
                        <p>QQ：963604618</p>
                    </div>

                </div>

            </div>
            <div class="row pt-5 mt-5 text-center">
                <div class="col-md-12">
                    <div class="mb-5">
                        <a href="#" class="pl-0 pr-3"><span class="icon-facebook"></span></a>
                        <a href="#" class="pl-3 pr-3"><span class="icon-twitter"></span></a>
                        <a href="#" class="pl-3 pr-3"><span class="icon-instagram"></span></a>
                        <a href="#" class="pl-3 pr-3"><span class="icon-linkedin"></span></a>
                    </div>
                </div>

            </div>
        </div>
    </footer>
</div>

<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jquery-migrate-3.0.1.min.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script src="js/jquery.countdown.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/bootstrap-datepicker.min.js"></script>
<script src="js/aos.js"></script>

<script src="js/main.js"></script>

</body>
</html>